Always set debugger to true in kernelspec #1191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the boolean
debugger
flag in the kernelspec file is determined at build time depending upon whetherdebugpy
is installed or not. I think it should always beTrue
, on the basis thatipykernel
supports a debugger in principle and the details of the available debugging are determined at runtime.This change has no effect on PyPI wheels or conda packages as the flag is always
True
in those, it only affects building from source. Becausedebugpy
is a compulsory dependency in thepyproject.toml
the flag is alwaysTrue
except when doing an editable install with build isolation (pip install -e .
) in which case it isFalse
. This is the recommended approach for installing from source specified in theREADME.md
, and is how I came across this problem.I have also updated
test_debugger.py
. There is a CI run that explicitly doesn't havedebugpy
installed and runstest_debugger.py
, but unfortunately in this situation all the tests in that file are skipped. So this CI run only really tests that there is no debugger-related functionality in any of the other test files. I have changedtest_debugger.py
so that all tests are run regardless of whetherdebugpy
is installed or not, and theassert
s are different in each situation. Often withoutdebugpy
installed the tests don't do anything particularly interesting, but they do confirm thatipykernel
doesn't block, or segfault, or raise an error in the non-debugpy
situation.The
test_debugger.py
tests are a little less readable now because of the newif
statements. An alternative approach would be to keeptest_debugger.py
as it is and add a newtest_not_debugger.py
file.